package One_11_Exception;

// 继承Exception,那么MyException就是一个异常类
public class MyException extends Exception{
    // 传递数字,数字大于10,抛出异常
    private int detail;

    public MyException(int a) {
        this.detail = a;
    }

    // toString:异常的打印信息
    @Override
    public String toString() {
        return "MyException{" + "detail=" + detail + '}';
    }
}
